package com.hyxt.utils;

import com.hyxt.DTO.PlatConfig;
import com.hyxt.DTO.PlatLinks;
import com.hyxt.handler.ServerHandler;
import com.hyxt.handler.SlaveHandler;
import com.hyxt.handler.TransferHandler;

import java.util.List;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author songm
 * @version v1.0
 * @Description 本地缓存数据
 * @Date: Create in 16:50 2017/12/20
 * @Modifide By:
 **/
public class Caches {

    //存PlatChannels的map，key为mainChannel、slaveChannel或transferChannel
    //可以通过三者任一找到该平台的三条链路<String,PlatChannels>
    //public static ConcurrentHashMap links = new ConcurrentHashMap("_links");

    //存放平台链路状态<platId,PlatLinks>
    public static ConcurrentHashMap<String,PlatLinks> platLinks = new ConcurrentHashMap();

    //存放平台配置文件信息<platId,PlatConfig>
    public static ConcurrentHashMap<String,PlatConfig> platConfigs = new ConcurrentHashMap();

    // <接入码,企业ID>
    public static ConcurrentHashMap<String,String> accessCodeToBusinessCache = new ConcurrentHashMap();

    // <车牌号+颜色,List<企业ID>>
    public static ConcurrentHashMap<String,List> plateToBusinessCache = new ConcurrentHashMap();

    //<接入码，加密码（new int[] { M1, IA1, IC1 }）>，解密时需要
    public static ConcurrentHashMap<String,int[]> accessCodeToM1IA1IC1Cache = new ConcurrentHashMap();

    // <流水号,接入码>
    public static ConcurrentHashMap<String,String> reqCache = new ConcurrentHashMap();

    // <mainChannelName,ServerHandler>
    public static ConcurrentHashMap<String,ServerHandler> serverHandlers = new ConcurrentHashMap();
    // <slaveChannelName,SlaveHandler>
    public static ConcurrentHashMap<String,SlaveHandler> clientHandlers = new ConcurrentHashMap();
    // <transferChannelName,TransferHandler>
    public static ConcurrentHashMap<String,TransferHandler> transferHandlers = new ConcurrentHashMap();
}
